package com.yq.cns

import com.fmt.mvi.learn.gobal.log
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.runBlocking
import org.junit.Test

import org.junit.Assert.*

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }

    @Test
    fun testFlowOperator() {
        runBlocking {
            val flow = flowOf(1, 2, 3, 4, 5)
            flow.filter {
                it % 2 == 0
            }.map {
                it * it
            }.onEach {

            }.collect {
                System.out.println(it)
            }
        }
    }
}